﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package org.aswing.border {
    import flash.display.*;
    import org.aswing.*;
    import org.aswing.geom.*;
    import org.aswing.graphics.*;
    import org.aswing.error.*;

    public class DecorateBorder implements Border {

        private var interior:Border;
        private var disContainer:Sprite;

        public function DecorateBorder(_arg1:Border){
            this.interior = _arg1;
        }
        public function setInterior(_arg1:Border):void{
            this.interior = _arg1;
        }
        public function getInterior():Border{
            return (this.interior);
        }
        public function getDisplayImp():DisplayObject{
            return (null);
        }
        public function updateBorderImp(_arg1:Component, _arg2:Graphics2D, _arg3:IntRectangle):void{
            throw (new ImpMissError());
        }
        public function getBorderInsetsImp(_arg1:Component, _arg2:IntRectangle):Insets{
            throw (new ImpMissError());
        }
        final public function getDisplay(_arg1:Component):DisplayObject{
            var _local3:DisplayObject;
            var _local4:DisplayObject;
            var _local2:Border = this.getInterior();
            if (_local2 != null){
                _local3 = _local2.getDisplay(_arg1);
                _local4 = this.getDisplayImp();
                if (_local3 == null){
                    return (_local4);
                };
                if (_local4 == null){
                    return (_local3);
                };
                if (this.disContainer == null){
                    this.disContainer = new Sprite();
                    this.disContainer.addChild(_local4);
                    this.disContainer.addChild(_local3);
                };
                return (this.disContainer);
            };
            return (this.getDisplayImp());
        }
        final public function updateBorder(_arg1:Component, _arg2:Graphics2D, _arg3:IntRectangle):void{
            var _local4:IntRectangle;
            this.updateBorderImp(_arg1, _arg2, _arg3);
            if (this.getInterior() != null){
                _local4 = this.getBorderInsetsImp(_arg1, _arg3).getInsideBounds(_arg3);
                this.getInterior().updateBorder(_arg1, _arg2, _local4);
            };
        }
        final public function getBorderInsets(_arg1:Component, _arg2:IntRectangle):Insets{
            var _local4:IntRectangle;
            var _local3:Insets = this.getBorderInsetsImp(_arg1, _arg2);
            if (this.getInterior() != null){
                _local4 = _local3.getInsideBounds(_arg2);
                _local3.addInsets(this.getInterior().getBorderInsets(_arg1, _local4));
            };
            return (_local3);
        }

    }
}//package org.aswing.border 
